#BWE == BWorld Engine.
#this is make file for BWE project.
#the target is libBWE.so examples and plugins.

TARGET = libBWE.so

ifdef LIB_STATIC
	LIB_TYPE = -static
else
	LIB_TYPE = -shared
endif

OUT_DIR = ../Output/

PRO_DIR = ./
OBJ_DIR = $(PRO_DIR)object/
INC_DIR = $(PRO_DIR)include/
SRC_DIR = $(PRO_DIR)source/

GPATH = ./object
VPATH = ./source
CPPFLAGS = -g -fPIC -I$(INC_DIR)

OBJECTS_3D = \
	BRender.o\
	BCuller.o\
	BMesh.o\
	BNode.o\
	BLight.o\
	BSpotLight.o\
	BDirectLight.o\
	BCamera.o\
	BControler.o\
	BLook.o\
	BState.o\
	BMaterial.o\
	BTexture.o\
	BProgram.o\
	BShader.o\
	BShape.o\
	BGeometry.o\
	BCircle.o\
	BCube.o\
	BCone.o\
	BSphere.o\
	BCylinder.o\
	BTorus.o\
	BRectangle.o\
	BMeshShape.o\
	BScreen.o\
	member_BScreen.o\
	member_BMesh.o\
	member_BNode.o\
	member_BLight.o\
	member_BCamera.o\
	member_BControler.o\
	member_BLook.o\
	member_BState.o\
	member_BMaterial.o\
	member_BTexture.o\
	member_BShape.o\
	member_BMeshShape.o\
	member_BGeometry.o\
	member_BRender.o\
	
OBJECTS_GUI = \
	BPainter.o\
	BWindow.o\
	BWidget.o\
	BLayout.o\
	BSpring.o\
	BViewer.o\
	BButton.o\
	BEvent.o\
	BMenu.o\
	BMenuBar.o\
	BAction.o\
	BDialog.o\
	BSplitter.o\
	BAudioEvent.o\
	BCreateEvent.o\
	BMouseEvent.o\
	BChangeEvent.o\
	BMoveEvent.o\
	BResizeEvent.o\
	BFocusEvent.o\
	BKeyEvent.o\
	BCharEvent.o\
	BPaintEvent.o\
	BCloseEvent.o\
	BUpdateEvent.o\
	IWidgetLayer.o\
	BComboBox.o\
	BCheckBox.o\
	BTextEdit.o\
	BToolBar.o\
	BSlider.o\
	BEdit.o\
	BSpinBox.o\
	BLabel.o\
	BScrollArea.o\
	BScrollBar.o\
	BScrollWidget.o\
	BTabWidget.o\
	BProgressBar.o\
	BTreeWidget.o\
	BTreeWidgetItem.o\
	BListWidget.o\
	BListWidgetItem.o\
	BGroupBox.o\
	BTableWidget.o\
	BTableWidgetItem.o\
	member_BMenu.o\
	member_BSlider.o\
	member_BSpinBox.o\
	member_BTabWidget.o\
	member_BScrollWidget.o\
	member_BMenuBar.o\
	member_BCheckBox.o\
	member_BTableWidget.o\
	member_BTableWidgetItem.o\
	member_BSplitter.o\
	member_BDialog.o\
	member_BTreeWidget.o\
	member_BTreeWidgetItem.o\
	member_BListWidget.o\
	member_BListWidgetItem.o\
	member_BComboBox.o\
	member_BAction.o\
	member_BToolBar.o\
	member_BLabel.o\
	member_BScrollArea.o\
	member_BScrollBar.o\
	member_BEdit.o\
	member_BTextEdit.o\
	member_BEvent.o\
	member_BPainter.o\
	member_BButton.o\
	member_BViewer.o\
	member_BSpring.o\
	member_BLayout.o\
	member_BWidget.o\
	member_BWindow.o\
	IComboBoard.o\

OBJECTS_CORE = \
	BFont.o\
    BOpenGL.o\
	BPalette.o\
	BTimer.o\
	BCursor.o\
	BChunk.o\
	BChunkItem.o\
	BEntry.o\
	BFile.o\
	BFileInfo.o\
	BFolder.o\
	BFolderInfo.o\
	BIcon.o\
	BImage.o\
	BBitmap.o\
	BIndexArray.o\
	BLibrary.o\
	BLogger.o\
	BClock.o\
	BObject.o\
	BRawSocket.o\
	BReadWrite.o\
	BScript.o\
	BSocket.o\
	BSpace.o\
	BTask.o\
	BTaskQueue.o\
	BTaskThread.o\
	BTcpServer.o\
	BTcpSocket.o\
	BThread.o\
	BUdpSocket.o\
	BSocketMonitor.o\
	BSocketNotifier.o\
	BUpdater.o\
	BAudioInput.o\
	BAudioOutput.o\
	member_BClock.o\
	member_BEntry.o\
	member_BTimer.o\
	member_BAudioInput.o\
	member_BAudioOutput.o\
	member_BObject.o\
	member_BImage.o\
	member_BFile.o\
	member_BFolder.o\
	member_BLibrary.o\
	member_BRawSocket.o\
	member_BSocket.o\
	member_BSocketMonitor.o\
	member_BSocketNotifier.o\
	member_BCursor.o\
	member_BTcpServer.o\
	member_BTcpSocket.o\
	member_BUdpSocket.o\
	member_BChunkItem.o\
	member_BChunk.o\
	member_BPalette.o\
	member_BFont.o\
	
OBJECTS = $(OBJECTS_CORE) $(OBJECTS_GUI) $(OBJECTS_3D)

#this is libBWE.so target
$(OUT_DIR)$(TARGET):$(OBJECTS)
	g++ -o $@ -fPIC -shared $(OBJECTS) -g -pthread -lGL -lX11 -lrt -lfreetype

BFont.o:BFont.cpp
	g++ -c $^ $(CPPFLAGS) -I/usr/local/include/freetype2
member_BFont.o:member_BFont.cpp member_BFont.h
	g++ -c $^ $(CPPFLAGS)  -I/usr/local/include/freetype2

.PHONY:clean
clean:
	-rm *.o
	-rm $(OUT_DIR)$(TARGET)

